<?php if ($sf_user->isAuthenticated()): ?>
    <h3 id="health-quality-title" class="grey-bg-title">My health conscience points</h3>
    <div id="health-quality-percent"><?php echo $healthConsciencePoints ?></div>
<?php endif; ?>
<h3 id="active-doctors-title" class="grey-bg-title">Recently active doctors</h3>
<div class="active-doctors">
    <?php foreach ($activeDoctors as $doctor): ?>
        <?php $user = $doctor->getUser() ?>
        <div class="active-doctor-row">
            <div class="inline-block">
                <div class="connection-photo">
                    <a href="<?php echo url_for('@profile_public?slug=' . $user->getSlug()) ?>"><?php include_partial("doctor_show/potrait", array("doctor" => $doctor, "height" => 32)) ?></a>
                </div>
            </div>
            <div class="inline-block connection-info">
                <a href="<?php echo url_for('@profile_public?slug=' . $user->getSlug()) ?>" class="name-title"><?php echo $user ?></a>
                <div class="doctor-speciality"><?php echo $doctor->getSpeciality() ?></div>
            </div>
            <div class="inline-block member-actions">
                <?php $connection = $user->getConnection($sf_user->getUserId()) ?>
                <div class="connet doctor-<?php echo $connection['relationship'] ?>" userid="<?php echo $user->getId() ?>" status="<?php echo $connection['status'] ?>"><?php echo ucfirst($connection['relationship']) ?></div>
            </div>
        </div>
    <?php endforeach; ?>
</div>
<h3 id="follow-doctors-title" class="grey-bg-title"><a href="<?php echo url_for('@static_find_a_doctor') ?>">Find a favorite doctor</a></h3>
<h3 id="invite-your-friends-title" class="grey-bg-title"><a id="invite-your-friends" href="<?php echo url_for('@refer_friend') ?>">Invite your friends to join DocPlus</a></h3>
<script type="text/javascript">
    $(document).ready(function(){         
        $("#invite-your-friends").live("click", function(){
            var url = '<?php echo url_for('@refer_friend') ?>';
            $.get(url, {}, function(data){
                if(data == 'signin'){
                    requestLogin();
                }
                else{
                    openPopup(url, '650px', '630px');
                }
            }, 'html');
        
            return false;
        });
    });
</script>